import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:岁亮亮
 * Date:2024-01-18
 * TIME:8:45
 */
public class Mylist {
    public static List<List<Integer>> generate(int n){
        List<List<Integer>> list=new ArrayList<>();
        List<Integer> list1=new ArrayList<>();
        list1.add(1);
        list.add(list1);

        for (int i = 0; i < n; i++) {
            List<Integer> curlist=new ArrayList<>();
            curlist.add(1);
            List<Integer> prelist=new ArrayList<>();
            prelist=list.get(i-1);
            for (int j = 0; j < i; j++) {
                int ret=prelist.get(j)+prelist.get(j-1);
                curlist.add(ret);
            }
            curlist.add(1);
             list.add(curlist);
        }
        return list;
    }
    public static void main(String[] args) {
        List<List<Integer>> ret=new ArrayList<>();
        ret=generate(5);
        System.out.println(ret);
    }
}
